#ifndef _BRIDGE_H_
#define _BRIDGE_H_

#include <string>
#include <stdio.h>

#include "lua.hpp"


class BridgeTest
{
public:
	BridgeTest()
	{
		m_string = "c++ test string";
		m_name ="default name";
	}
	~BridgeTest()
	{
		printf("destory BridgeTest\n");
	}

	void Test(int a, int b)
	{
		printf("c++ test function %d+%d=%d\n", a, b, a+b);
	}

	void SetName(std::string name)
	{
		m_name = name;
	}

	std::string GetName() const 
	{
		return m_name;
	}

	static void StaticShow()
	{
		printf("static show\n");
	}

	int cFunc(lua_State* L)
	{
		lua_pushstring(L, "str1");
		lua_pushstring(L, "str2");
		return 2;
	}

	virtual void VirtualTest()
	{
		printf("Virtual Test A\n");
	}

	std::string m_string;
	std::string m_name;
	static int m_static_data;
};


class BridgeTestChild : public BridgeTest
{
public:
	BridgeTestChild(std::string test)
		:m_child(test)
	{
		printf("call BridgeTestChild constructor\n");
	}

	~BridgeTestChild()
	{

	}

	virtual void VirtualTest()
	{
		printf("Virtual Test B\n");
	}

	std::string m_child;
};

BridgeTestChild* GetInstance();

#endif
